var express = require('express')
var sdk = require('./jiyan')
var api = express()
api.use(express.urlencoded({extended:false}))
api.post('/getw', function(req, res){
    var x = req.body.x;
    var c = JSON.parse(req.body.c);
    var track = JSON.parse(req.body.track);
    var s = req.body.s;
    var gtStr = req.body.gt;
    var newChennid = req.body.challenge;
    var passtime = req.body.passtime;
    token = sdk.init(x, c, s, gtStr , newChennid,track,passtime)
    res.send(token)
})
var server = api.listen('8090', function(){

})